package k.order.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import k.daimai.entity.DmCategory;
import k.daimai.entity.DmProduct;
import k.order.mapper.DmProductMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 大麦商城-商品表-73 前端控制器
 * </p>
 *
 * @author k
 * @since 2025-03-01
 */
@RestController
@RequestMapping("product")
public class DmProductController {
    @Autowired
    DmProductMapper dmProductMapper;
    @GetMapping("hots")
    public List<DmProduct> getHotProducts() {
        LambdaQueryWrapper<DmProduct> lq=new LambdaQueryWrapper<DmProduct>();
        lq.eq(DmProduct::getIsHot,1);
        return dmProductMapper.selectPage(new Page<DmProduct>(1,10), lq).getRecords();
    }
}
